#!/bin/bash
# Example with 16 MPI tasks and 16 tasks per node.
#
# ~/MyPapers/Mayors/Estimation/Aug_2024

#SBATCH -A econ
#SBATCH --partition=normal
#
# Number of tasks per node 
#SBATCH --tasks-per-node=64
#
# Number of CPUs requested
#SBATCH -c 2

# Runtime of this jobs is less then 12 hours.
#SBATCH --time=24:00:00
#
#SBATCH --mem=32G

# Clear the environment from any previously loaded modules
# # module purge > /dev/null 2>&1

# Unload openmpi to use intel
module unload openmpi4

# set intel family
export LMOD_FAMILY_MPI=impi

export MKL_DEBUG_CPU_TYPE=5
export MKL_CBWR=COMPATIBLE

LD_PRELOAD=/home/mazzocco/libfakeintel.so

#module use /usr/local/eb-gcc83/modules/all

# Load the module environment suitable for the job
#module load EasyBuild; module use /usr/local/easybuild/modules/all; module load intel/2020a
#module load EasyBuild; module use /usr/local/eb-gcc93/modules/all; module load intel/2020a
module load EasyBuild; module use /opt/ohpc/pub/eb-gcc93/modules/all; module load intel/2020a  

# And finally run the job
#prun ./debug.exe
#prun ./debug2.exe
#prun ./debug3.exe
#prun ./debug4.exe
#prun ./debug5.exe
prun ./debug6.exe
#prun ./mayor.exe
#prun ./mayor1.exe
#prun ./mayor2.exe
#prun ./mayor3.exe
#prun ./mayor4.exe
#prun ./mayor5.exe
#prun ./mayor6.exe
#prun ./mayor7.exe
#prun ./mayor8.exe
#prun ./mayor9.exe
#prun ./mayor10.exe
#prun ./mayor21.exe

# End of submit file
# Type before you start working in fortran
# export I_MPI_PMI_LIBRARY=/software/slurm-current-$DISTARCH/lib/libpmi.so
# To submit: sbatch 'name of submitting file'
# sacct to check jobs running
# scancel job# to kill a job
# make clean; make module; make mayor1
